﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace dbPoll_Application.Models
{
    public class ClientCode
    {
        public virtual int Code { get; set; }
        public virtual User Owner { get; set; }

        public ClientCode()
        {
            this.Code = -1;
            this.Owner = new User();
        }

        public ClientCode(User owner)
        {
            this.Code = -1;
            this.Owner = owner;
        }

        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return false;
            }
            var clientcode = obj as ClientCode;
            if ((System.Object)clientcode == null)
            {
                return false;
            }
            return this.Code == clientcode.Code;
        }

        public override int GetHashCode()
        {
            return string.Format("{0}", Code).GetHashCode();
        }
    }
}
